package com.example.client1;

import com.example.client1.feign.Test1Feign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class TestController{

//    @Autowired
//    RestTemplate restTemplate;

    @Autowired
    Test1Feign test1Feign;

/*

    @Autowired
    TestHaFeign testHaFeign;
*/


/*    @GetMapping("test1")
    public String test1(){
        ResponseEntity<String> forEntity = restTemplate.getForEntity("http://CLIENT1/test", String.class);
        String body = forEntity.getBody();
        return body;
    }*/
    @GetMapping("test2")
    public String test2(){
        String test = test1Feign.test();
        System.out.println(test);
        return test;
    }

/*
    @GetMapping("test3")
    public String test3(){
        String test = testHaFeign.test();
        System.out.println(test);
        return test;
    }
*/


}
